from twisted.application import internet, service
from franticfallacy import communications, engine, data, config

world = data.loadWorld(config.worldpath)

chatFac = communications.ChatFactory()

chatFac.motd = config.motd
chatFac.world = world

chatService = service.MultiService()
internet.TCPServer(config.port, chatFac).setServiceParent(chatService)

application = service.Application("Chatserver")
chatService.setServiceParent(application)